package org.dromara.autocode.domain.entity;

import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.dromara.common.core.validate.AddGroup;
import org.dromara.common.core.validate.EditGroup;
import org.dromara.common.mybatis.core.domain.BaseEntity;

import java.io.Serial;


@Data
@EqualsAndHashCode(callSuper = true)
@TableName("sys_auto_code_rule")
public class SysAutoCodeRule extends BaseEntity {

  @Serial
  private static final long serialVersionUID=1L;


  @ExcelProperty(value = "规则ID")
  @NotNull(message = "规则ID不能为空", groups = { EditGroup.class })
  @TableId(value = "rule_id")
  private Long ruleId;

  @ExcelProperty(value = "规则编码")
  @NotBlank(message = "规则编码不能为空", groups = { AddGroup.class, EditGroup.class })
  private String ruleCode;

  @ExcelProperty(value = "规则名称")
  @NotBlank(message = "规则名称不能为空", groups = { AddGroup.class, EditGroup.class })
  private String ruleName;

  @ExcelProperty(value = "描述")
  private String ruleDesc;

  @ExcelProperty(value = "最大长度")
  private Long maxLength;

  @ExcelProperty(value = "是否补齐")
  @NotBlank(message = "是否补齐不能为空", groups = { AddGroup.class, EditGroup.class })
  private String isPadded;

  @ExcelProperty(value = "补齐字符")
  private String paddedChar;

  @ExcelProperty(value = "补齐方式")
  private String paddedMethod;

  @ExcelProperty(value = "是否启用")
  @NotBlank(message = "是否启用不能为空", groups = { AddGroup.class, EditGroup.class })
  private String enableFlag;

  @ExcelProperty(value = "备注")
  private String remark;

  @ExcelProperty(value = "预留字段1")
  private String attr1;

  @ExcelProperty(value = "预留字段2")
  private String attr2;

  @ExcelProperty(value = "预留字段3")
  private Long attr3;

  @ExcelProperty(value = "预留字段4")
  private Long attr4;
}

